package com.hnluchuan.bmjlearning.web.controller.admin;

import java.util.Map;

import com.hnluchuan.bmjlearning.common.ResultCode;
import com.hnluchuan.bmjlearning.common.UserType;
import com.hnluchuan.bmjlearning.dto.UserDTO;
import com.hnluchuan.bmjlearning.web.controller.BaseController;
import com.hnluchuan.utils.exception.BizException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.hnluchuan.bmjlearning.web.controller.CoreBaseController;

@Controller
@RequestMapping(value = "/admin/index", produces = "text/html;charset=UTF-8")
public class AdminIndexController extends BaseController {
	
    @RequestMapping("index_v3")
    public String index_v3(Map<String, Object> map) throws Exception {
        UserDTO userDTO = getCurrentUserDTO();
        if(userDTO == null){
            throw new BizException(ResultCode.NotAuthorized.getRemark());
        }
        Boolean canDisplayBmj = userDTO.getType() == UserType.Clinic.getValue();
        map.put("canDisplayBmj", canDisplayBmj);
        return "admin/index_v3";
    }
    
}	
